<html>
<head><meta charset="utf-8"><title>Empty regions and LBL · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html">Empty regions and LBL</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176269749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176269749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176269749">(Sep 21 2019 at 15:45)</a>:</h4>
<p>Have we decided that this should compile? <a href="https://github.com/rust-lang/rust/blob/0a985f2c86add139d880882c968e68747b366be6/src/test/ui/hrtb/due-to-where-clause.rs" target="_blank" title="https://github.com/rust-lang/rust/blob/0a985f2c86add139d880882c968e68747b366be6/src/test/ui/hrtb/due-to-where-clause.rs">https://github.com/rust-lang/rust/blob/0a985f2c86add139d880882c968e68747b366be6/src/test/ui/hrtb/due-to-where-clause.rs</a><br>
cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="176269875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176269875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176269875">(Sep 21 2019 at 15:48)</a>:</h4>
<p>NLL is allowing <code>for&lt;'b&gt; FooS&lt;'_&gt;: Foo&lt;'b&gt;</code> on line 6 because <code>'_</code> is completely unconstrained, so it can be <code>'empty</code>.</p>



<a name="176269900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176269900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176269900">(Sep 21 2019 at 15:49)</a>:</h4>
<p>The lexical region solver doesn't allow this kind of reasoning (and NLL usually doesn't because most regions end up with at least a liveness constraint).</p>



<a name="176270967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176270967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176270967">(Sep 21 2019 at 16:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> seems like sound reasoning on NLL's part; why would we not allow this?</p>



<a name="176271220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176271220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176271220">(Sep 21 2019 at 16:26)</a>:</h4>
<p>Because such reasoning applies only in very specific situations. The fairly similar <code>({test::&lt;FooS&lt;'_&gt;&gt;}(&amp;mut 42));</code> fails to compile with and without NLL</p>



<a name="176271299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176271299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176271299">(Sep 21 2019 at 16:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> why does the block version not work?</p>



<a name="176271313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176271313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176271313">(Sep 21 2019 at 16:29)</a>:</h4>
<p><code>'_</code> is now live between the block finishing evaluation and the function being called, so is not <code>'empty</code>.</p>



<a name="176271598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176271598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176271598">(Sep 21 2019 at 16:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> I guess I don't understand how that came to be.</p>
<p>The reasoning "<code>'_</code> is completely unconstrained, so it can be <code>'empty</code>" seems sane tho.</p>



<a name="176404099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176404099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176404099">(Sep 23 2019 at 20:04)</a>:</h4>
<p>I'm not very happy with 'empty, <span class="user-mention" data-user-id="116118">@Matthew Jasper</span></p>



<a name="176404138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176404138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176404138">(Sep 23 2019 at 20:05)</a>:</h4>
<p>that's the main reason I backed out from the universe work</p>



<a name="176404346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176404346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176404346">(Sep 23 2019 at 20:06)</a>:</h4>
<p>partly because it doesn't have an <em>obvious</em> analogous in polonius</p>



<a name="176404367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176404367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176404367">(Sep 23 2019 at 20:07)</a>:</h4>
<p>though you can make interpretations that make sense</p>



<a name="176404505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176404505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176404505">(Sep 23 2019 at 20:08)</a>:</h4>
<p>Interesting question to ask how we would deny this in NLL mode -- I guess by requiring that all the types outlive the call, which .. I'm a <em>bit</em> surprised we <em>don't</em> require</p>



<a name="176404531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176404531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176404531">(Sep 23 2019 at 20:08)</a>:</h4>
<p>Is that an oversight?</p>



<a name="176404996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176404996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176404996">(Sep 23 2019 at 20:13)</a>:</h4>
<p>Hmm, is <a href="https://github.com/rust-lang/rust/blob/66bf391c3aabfc77f5f7139fc9e6944f995d574e/src/librustc_mir/borrow_check/nll/type_check/mod.rs#L1583-L1589" target="_blank" title="https://github.com/rust-lang/rust/blob/66bf391c3aabfc77f5f7139fc9e6944f995d574e/src/librustc_mir/borrow_check/nll/type_check/mod.rs#L1583-L1589">this comment just wrong</a>?</p>



<a name="176405136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176405136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176405136">(Sep 23 2019 at 20:15)</a>:</h4>
<p>seems like it might be</p>



<a name="176405152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/176405152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#176405152">(Sep 23 2019 at 20:15)</a>:</h4>
<p>in particular, we probably don't require that the types of <em>constants</em> are live at the point of us?</p>



<a name="177097156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177097156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177097156">(Oct 01 2019 at 20:53)</a>:</h4>
<p>I guess that <a href="https://github.com/rust-lang/rust/pull/64749/commits/9b9b7f18805949939d9e45a4b99a9ab4b7d4b768" target="_blank" title="https://github.com/rust-lang/rust/pull/64749/commits/9b9b7f18805949939d9e45a4b99a9ab4b7d4b768">this commit</a> from <a href="https://github.com/rust-lang/rust/issues/64749" target="_blank" title="https://github.com/rust-lang/rust/issues/64749">#64749</a> address this, <span class="user-mention" data-user-id="116118">@Matthew Jasper</span>?</p>



<a name="177097706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177097706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177097706">(Oct 01 2019 at 21:00)</a>:</h4>
<p>that's also how I understood it</p>



<a name="177097788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177097788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177097788">(Oct 01 2019 at 21:01)</a>:</h4>
<p>Yes</p>



<a name="177098013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177098013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177098013">(Oct 01 2019 at 21:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> what happened to the work you were doing to improve these errors?</p>



<a name="177098073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177098073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177098073">(Oct 01 2019 at 21:05)</a>:</h4>
<p>I was working on a PR that made them more common without flags.</p>



<a name="177098090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177098090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177098090">(Oct 01 2019 at 21:05)</a>:</h4>
<p>ah damn, the issues were closed with the leak-check revival and I forgot about it, I think I've seen some of Aaron Hill's PRs touch on those areas</p>



<a name="177098242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177098242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177098242">(Oct 01 2019 at 21:07)</a>:</h4>
<p>I do remember having issues emitting "expected/found" trait errors at this point of the pipeline, and think have seen others with this same problem</p>



<a name="177098353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177098353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177098353">(Oct 01 2019 at 21:09)</a>:</h4>
<p>I can find that work again, and if that's ok we can talk about those related issues and how to fix then</p>



<a name="177098952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177098952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177098952">(Oct 01 2019 at 21:16)</a>:</h4>
<p>(some of the work was merged though, but there were a bunch of other paths triggering this specific unclear error)</p>



<a name="177102179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/Empty%20regions%20and%20LBL/near/177102179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/Empty.20regions.20and.20LBL.html#177102179">(Oct 01 2019 at 22:06)</a>:</h4>
<blockquote>
<p>I've seen some of Aaron Hill's PRs touch on those areas</p>
</blockquote>
<p>for example <a href="https://github.com/rust-lang/rust/issues/63678" target="_blank" title="https://github.com/rust-lang/rust/issues/63678">#63678</a> just in case you hadn't seen it</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>